#lang racket


(provide
 (struct-out node)
 
 ; points
 
 (struct-out point-node)
 

 ; lines
 
 (struct-out arc-node)
 (struct-out elliptical-arc-node)
 (struct-out ellipse-node)
 (struct-out line-node)
 (struct-out nurbs-curve-node)
 (struct-out spline-node)
 
 
 ; surfaces
 
 (struct-out donut-node)
 (struct-out ngon-node)
 (struct-out nurbs-surface-node)
 (struct-out star-node)
 (struct-out surface-node)
 
 
 ; solids
 
 (struct-out box-node)
 (struct-out cone-node)
 (struct-out cone-frustrum-node)
 (struct-out cylinder-node)
 (struct-out pyramid-node)
 (struct-out sphere-node)
 
 
 ; generic shapes
 
 (struct-out circle-node)
 (struct-out rectangle-node)
 
 
 ; transformations
 
 (struct-out extrude-node)
 (struct-out intersect-node)
 (struct-out join-node)
 (struct-out loft-node)
 (struct-out move-node)
 (struct-out offset-node)
 (struct-out rotate-node)
 (struct-out scale-node)
 (struct-out subtract-node)
 (struct-out sweep-node)
 (struct-out thicken-node)
 (struct-out union-node)
 
 
 ; lang
 
 (struct-out align-node)
 (struct-out on-node))


; node

(struct node ())


; points

(struct point-node node (c))

 
; lines

(define-struct (arc-node node)
  (angle radius))

(define-struct (elliptical-arc-node node)
  (angle x-radius y-radius))

(define-struct (ellipse-node node)
  (x-radius y-radius))

(define-struct (line-node node)
  (closed? cs))

(define-struct (nurbs-curve-node node)
  (controls knots))

(define-struct (spline-node node)
  (closed? cs type))


; surfaces

(define-struct (donut-node node)
  (inner-radius outer-radius))

(define-struct (ngon-node node)
  (width sides))

(define-struct (nurbs-surface-node node)
  (controls u-knots v-knots))

(define-struct (star-node node)
  (width sides stride))

(define-struct (surface-node node)
  (shapes))


; solids

(define-struct (box-node node)
  (width length height))

(define-struct (cone-node node)
  (radius height))

(define-struct (cone-frustrum-node node)
  (base-radius top-radius height))

(define-struct (cylinder-node node)
  (radius height))

(define-struct (pyramid-node node)
  (width sides height))

(define-struct (sphere-node node)
  (radius))


; generic shapes

(define-struct (circle-node node)
  (type radius))

(define-struct (rectangle-node node)
  (width length))


; transformations

(define-struct (extrude-node node)
  (length shape))

(define-struct (intersect-node node)
  (shape1 shape2))

(define-struct (join-node node)
  (shapes))

(define-struct (loft-node node)
  (closed? shapes))

(define-struct (move-node node)
  (c shape))

(define-struct (offset-node node)
  (distance shape))

(define-struct (rotate-node node)
  (angle normal shape))

(define-struct (scale-node node)
  (c shape))

(define-struct (subtract-node node)
  (shape1 shape2))

(define-struct (sweep-node node)
  (path shape))

(define-struct (thicken-node node)
  (distance shape))

(define-struct (union-node node)
  (shape1 shape2))


; lang

(define-struct (align-node node)
  (type shape))

(define-struct (on-node node)
  (type shapes))